This invention relates in general to Universal Serial Bus (“USB”) devices, and in particular to the use of virtual endpoints in such devices.
An increasing number of different functions have now been incorporated in computer peripheral devices. These functions may include printing, signal transmission through telephone lines by means of modems, video and audio signal transmission, telephone communication and broadband transmission. The Universal Serial Bus (“USB”) specification Revision 2.0 (referred to herein as “USB Specification”, which is incorporated herein in its entirety by reference), available from http://www.usb.org/developers/docs.html, specifies up to 31 physical endpoints. Aside from endpoint zero which is used for default control, these endpoints may be used in a computer peripheral for controlling up to 30 communication or data pipes, each data pipe used for data transfer between the computer peripheral device and the host computer for supporting a particular application or function of the peripheral device.
As set forth in Section 5.3.1 of the USB Specification, an endpoint is a uniquely identifiable portion of a USB device that is the terminus of a communication flow between the host and device. Each USB logical device is composed of a collection of independent endpoints. Each logical device has a unique address assigned by the system at device attachment time. Each endpoint on a device is given at design time a unique device-determined identifier called the endpoint number. Each endpoint has a device-determined direction of data flow. The combination of the device address, endpoint number, and direction allows each endpoint to be uniquely referenced. Each endpoint is a simplex connection that supports data flow in one direction from the point of view of the host: either input (from device to host) or output (from host to device). In other words, a computer peripheral device may contain more than one USB logical device, where each logical device is treated separately by the host controller from another logical device in the same peripheral.
According to the USB Specification, the data pipes associated with all the endpoints except for endpoint zero are uni-directional. Thus, if data is to be transferred in both directions between the host computer and the peripheral device for a particular function or application, two data pipes would be required: one for the host computer to send data to the peripheral device and the other for the peripheral device to send data to the host computer. Certain types of functions or applications may require more than one data pipe in the same direction. For example, audio signals may require two or more data pipes for each direction for stereo sound or surround sound.
At the host side, the data transfer is handled by a microprocessor which sends tokens to the USB peripheral device requesting endpoints to support one or more applications. Such tokens would include information for identifying the data pipe involved and are known as logical endpoints. On the side of the USB device, hardware is used to support data transfer in the associated data pipe, where such hardware is known as a physical endpoint in accordance with the USB Specification. Each physical endpoint is associated with allocated memory (such as FIFOs) and registers. A match is found between a logical endpoint requested by the host with a physical endpoint in the USB peripheral device during initialization or during the process of establishing communication between the host and the device for data transfer through a particular data pipe.
When the host computer attempts to communicate with a USB peripheral device through a data pipe to support a particular function, the host computer will send a token containing information related to a logical endpoint for the data pipe. When the token is received by the USB device controller in the USB peripheral device, the USB device controller would match the logical endpoint information with that of the physical endpoints of the peripheral device. If a match is discovered, the USB device controller would respond to the host computer to establish the data pipe communication. If, however, the logical endpoint requested by the host computer is not found to match any one of the physical endpoints of the peripheral, such request by the host computer is simply denied so that the peripheral device is unable to support such function. This can, of course, be avoided if a USB device controller is designed with all 30 physical endpoints (in addition to endpoint zero) that are possible under the USB Specification.
However, if a USB device controller is designed with all 30 physical endpoints in addition to endpoint zero that are possible under the USB Specification, then the controller chip will become unnecessarily complex and requires a large die to accommodate all of the endpoints. Since typically many fewer functions or applications than 30 need to be supported simultaneously, if a USB device controller is designed with all 30 physical endpoints in addition to endpoint zero, then a large number of the physical endpoints would be idle most of the time. Including enough memory and registers to support all 30 physical endpoints in addition to endpoint zero is inefficient and costly.
Due to size and cost considerations explained above, most USB device controllers presently marketed do not include all 30 physical endpoints in addition to endpoint zero. In fact, most controllers contain only a few physical endpoints in addition to endpoint zero. In conventional designs, each physical endpoint in a computer USB device peripheral is identified with a particular data pipe and cannot be switched or changed to support a different data pipe between the host computer and the computer peripheral. Therefore, when computer peripherals are called upon to be increasingly versatile and perform many different functions, the few physical endpoints now being provided in the USB device controllers now on the market may not be adequate to support as many functions as desired by consumers. It is therefore desirable to provide USB devices with fewer physical endpoints than possible under the USB specification, where such devices still are adequate for supporting an increasing number of functions and applications desired by consumers in computer peripherals.